☰
Home
Preface
Book Contents
Chapter Introductions
AI Chatbot
R-Code
Python Code
R Tutorial
Python Tutorial
Master Dataset
Additional Datasets
Additional Exercises
Figures and Slides
Data Visualization
Sample Syllabus
Errata and New Material
News
Feedback
About
Home
Preface
Book Contents
Chapter Introductions
AI Chatbot
AI Chatbot
Code and Datasets
R Code
YouTube Tutorial for R
Python Code
YouTube Tutorials for Python
Master Dataset for the Book
Resources
Figures and Slides
Addtional Excercises
Data Visualization
Sample Syllabus
Errata and New Material
News
Book News
Send Feedback
About
Home
Preface
Book Contents
Chapter Introductions
AI Chatbot
AI Chatbot
Code and Datasets
R Code
YouTube Tutorial for R
Python Code
YouTube Tutorials for Python
Master Dataset for the Book
Resources
Figures and Slides
Addtional Excercises
Data Visualization
Sample Syllabus
Errata and New Material
News
News
Send Us Feedback
☰
About
Home
Preface
Book Contents
Chapter Introductions
AI Chatbot
AI Chatbot
Code and Datasets
R-Code
R Tutorial
Python Code
Python Tutorial
Master Dataset
Resources
Figures/Slides
Additional Exercises
Data Visualization
Sample Syllabi
Errata
News
Book News
Send Feedback
Contents
Brief Contents
Chapter 1: Basic Matrix Operations
Chapter 2: Matrix Theory and Visualization
Chapter 3: Matrix Applications to Machine Learning
Chapter 4: Matrix Applications to Regression Models
Appendix A: A Tutorial of R and RStudio
Appendix B: Visualization of Matrices
Full Table of Contents
Preface viii
Acknowledgements xiii
1 Basic Matrix Operations 1
1.1 Matrix as a data array 1
1.2 Matrix Algebra 3
1.2.1 Matrix equality, addition and subtraction 3
1.2.2 Matrix multiplication 4
1.3 Some Useful Operations for Matrices in Data Science but Not Covered in Traditional Linear Algebra Books 10
1.3.1 Delete a Row or Column or Both; a Sub-Matrix 10
1.3.2 Insert Rows or/and Columns to a Matrix 11
1.3.3 Statistics of the row or column data 12
1.3.4 Sweep a martrix by a vector 12
1.3.5 Conversions between a Vector and a Matrix 14
1.3.6 Reduce Dimensions of an n-Dimensional Array 14
1.4 A Set of Linear Equations 15
1.5 Eigenvalues and eigenvectors of a square space matrix 16
1.5.1 Matrices of data anomalies, standardized anomalies, covariance, and correlation 17
1.5.2 Eigenvectors and their corresponding eigenvalues 19
1.6 An SVD representation model for space-time data 20
1.6.1 Space-Time Data Matrix and Its decomposition 20
1.6.2 SVD of the Space-Time Anomaly Data Matrix and Eigenvalue Problem of a Covariance Matrix 22
1.7 Image analysis using SVD and R 25
1.7.1 Data for a color photo and its grayscale figure 25
1.7.2 SVD of the grayscale photo data 26
1.7.3 Reconstructing a color photo from the data of monotone photos 29
1.8 Mass balance for chemical equations in marine chemistry 31
1.9 Multivariate linear regression using matrix notations 32
1.10 Chapter summary 34
References and Further Readings 37
Exercises 38
2 Matrix Theory and Visualization 41
2.1 Matrix Definitions 41
2.2 Fundamental Properties of Matrices 44
2.3 Some basic concepts and theories of linear algebra 49
2.3.1 Linear equations 49
2.3.2 Linear transformations 50
2.3.3 Linear independence 51
2.3.4 Determinants 52
2.3.5 Rank of a matrix 53
2.4 Eigenvectors and eigenvalues 56
2.4.1 Definition of eigenvectors and eigenvalues 56
2.4.2 Properties of eigenvectors and eigenvalues for a symmetric matrix 60
2.5 Hadammard and Other Matrix Multiplications 62
2.5.1 Hadamard Product of Two Matrices of the Same Dimensions 63
2.5.2 Jordan Product of Two Matrices of the Same Dimensions 63
2.5.3 Commutator of Two Matrices of the Same Dimensions 63
2.5.4 Outer Product of Two Vectors and Two Matrices 64
2.5.5 Kronecker Product of Two Matrices of the Same Dimensions 66
2.6 Direct Sum of Two Matrices 67
2.7 Visualization of Eigenvalues and Eigenvectors for a Covariance Matrix 67
2.8 Singular Value Decomposition 68
2.8.1 SVD formula and a simple SVD examlpe 68
2.9 SVD for the standardized sea level pressure data of Tahiti and Darwin 74
2.10 Chapter Summary 76
References and Further Readings 78
Exercises 79
3 Matrix Applications to Machine Learning 83
3.1 K-means clustering 83
3.1.1 K-means set up and trivial examples 84
3.1.2 The number of exhaustive K clusters from N points 90
3.1.3 A K-means algorithm 91
3.1.4 K-means clustering for the daily Miami weather data 93
3.2 Support vector machine 103
3.2.1 SVM for a system of three points labeled in two categories 108
3.2.2 SVM mathematical formulation for a system of many points in two categories 112
3.3 Random forest method for classification and regression 118
3.3.1 RF flower classification for a benchmark iris dataset 118
3.3.2 RF regression for the daily ozone data of New York City 125
3.3.3 What does a decision tree look like? 129
3.4 Neural network and deep learning 132
3.4.1 An NN model for an automized decision system 132
3.4.2 An NN prediction of iris species 139
3.5 Chapter Summary 143
References and Further Readings 144
Exercises 145
4 Matrix Applications to Regression Models 148
4.1 Simple linear regression 148
4.1.1 Temperature lapse rate and an approximately linear model 148
4.1.2 Assumptions and formula derivations of the single variate linear regression 152
4.1.3 Statistics of slope and intercept: Distributions, confidence intervals, and inference 163
4.2 Multiple linear regression 176
4.2.1 Calculating the Colorado TLR when taking location coordinates into account 176
4.2.2 Formulas for estimating parameters in the multiple linear regression 179
4.3 Nonlinear fittings using the multiple linear regression 181
4.3.1 Diagnostics of linear regression: An example of global temperature 181
4.3.2 Fit a third order polynomial 186
4.4 Linear Regression by Weighted Least Squares 189
4.5 Chapter Summary 190
References and Further Readings 191
Exercises 192
Appendix A A Tutorial of R and R Studio 195
A.1 Download and install R and R-Studio 195
A.2 R Tutorial 196
A.2.1 R as a smart calculator 197
A.2.2 Define a sequence in R 198
A.2.3 Define a function in R 199
A.2.4 Plot with R 199
A.2.5 Symbolic calculations by R 200
A.2.6 Vectors and matrices 201
A.2.7 Simple statistics by R 204
A.3 Online Tutorials 205
A.3.1 Youtube tutorial: for true beginners 206
A.3.2 Youtube tutorial: for some basic statistical summaries 206
A.3.3 Youtube tutorial: Input data by reading a csv file into R 206
A.4 Chapter Summary 208
References and Further Readings 210
Exercises 211
Appendix B Visualization of Matrices 214
References and Further Readings 246
Index 251